package com.aaa.demo09;

import java.lang.reflect.Field;

/**
 * @author 荆豪峰
 * @version 1.0
 */
public class Test09 {
    public static void main(String[] args)throws Exception {
        Class<Student> studentClass = Student.class;
        Field[] fields = studentClass.getFields();
        for (Field field : fields) {
            System.out.println(field);
        }
        Field name = studentClass.getField("name");
        System.out.println(name);
    }
}
class Student extends People {
    public String name;
    private int age;
}
class People{
    public String address;
    private int id;
}